// Copyright (c) 2019 Presto Labs Pte. Ltd.
// Author: donggu

#include "coin2/base/string_util.h"

#include <doctest.h>

DOCTEST_TEST_CASE("coin2/base/string util") {
  DOCTEST_SUBCASE("split") {
    DOCTEST_CHECK(
        Split(".Futures.Okex..v3.", ".") ==
        std::vector<std::string>{"", "Futures", "Okex", "", "v3", ""});

    DOCTEST_CHECK(
        Split(".-BTC.USD-2020392.", ".-") ==
        std::vector<std::string>{"", "", "BTC", "USD", "2020392", ""});

    DOCTEST_CHECK(Split("", ".") == std::vector<std::string>{""});

    DOCTEST_CHECK(Split(".", ".") == std::vector<std::string>{"", ""});
  }
}
